package acs.offer.collection;

import java.util.HashMap;
import java.util.Map;

public class Params {

	private Map<String, Object> map = new HashMap<>();

	public <T> T get(String key) {
		return (T) map.getOrDefault(key, null);
	}

	public <T> T getOrDefault(String key,T t) {
		return (T) map.getOrDefault(key, t);
	}

	public Params put(String key, Object value) {
		map.put(key, value);
		return this;
	}

	public static Params build() {
		return new Params();
	}
	
	public static void main(String[] args) {
		Params params = new Params();
		params.put("a", 1);
		params.put("b", 2);
		Integer object = params.get("a");
		System.out.println(object);
	}
	
	
}
